update travis for xenial (#265)
authortsteven4 <tsteven4@users.noreply.github.com>
Sun, 4 Nov 2018 17:36:58 +0000 (10:36 -0700)
committerGitHub <noreply@github.com>
Sun, 4 Nov 2018 17:36:58 +0000 (10:36 -0700)
* update travis to use xenial.

add new travis target to build on xenial.
switch travis coverage generation to xenial.
update codacy upload tool for compatibility with newer java on xenial.

* fix gcov issues with "cannot open notes file"

.travis.yml
GPSBabel.pro
tools/travis_install_linux_local [new file with mode: 0755]
tools/travis_script_linux_coverage

index aa55c916ca9aab21e8b42e9efd59f0a4a2b90c09..536534e0ba7e8bd8a78347ea256e0ee8fe7969ee 100644 (file)
@@ -7,11 +7,37 @@ matrix:
       sudo: required
       services: docker
       compiler: gcc
+      env:
+        - BUILD_TYPE="docker"
     - os: linux
       dist: trusty
       sudo: required
       services: docker
       compiler: clang
+      env:
+        - BUILD_TYPE="docker"
+    - os: linux
+      dist: xenial
+      sudo: required
+      compiler: gcc
+      env:
+        - BUILD_TYPE="local"
+      addons:
+        apt:
+          packages:
+            - expat
+            - fop
+            - valgrind
+            - xsltproc
+            - libxml2-utils
+            - libusb-dev
+            - docbook-xml
+            - docbook-xsl
+            - libgl1-mesa-dev
+      cache:
+        directories:
+          - $HOME/Qt
+        timeout: 600
     - os: osx
       compiler: clang
       cache:
@@ -19,11 +45,11 @@ matrix:
           - $HOME/Qt
         timeout: 600
     - os: linux
-      dist: trusty
+      dist: xenial
       sudo: required
       compiler: gcc
       env:
-        - GEN_COVERAGE="true"
+        - BUILD_TYPE="coverage"
       addons:
         apt:
           packages:
@@ -34,12 +60,14 @@ matrix:
           - $HOME/Qt
 
 install:
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${BUILD_TYPE}" = "coverage" ]; then ./tools/travis_install_linux_coverage; fi
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${BUILD_TYPE}" = "local" ]; then source ./tools/travis_install_linux_local; fi
   - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then source ./tools/travis_install_osx; fi
-  - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${GEN_COVERAGE}" = "true" ]; then ./tools/travis_install_linux_coverage; fi 
 
 script:
-  - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${GEN_COVERAGE}" != "true" ]; then ./tools/travis_script_linux_docker; fi 
-  - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${GEN_COVERAGE}" = "true" ]; then ./tools/travis_script_linux_coverage; fi 
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${BUILD_TYPE}" = "coverage" ]; then ./tools/travis_script_linux_coverage; fi
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${BUILD_TYPE}" = "docker" ]; then ./tools/travis_script_linux_docker; fi
+  - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${BUILD_TYPE}" = "local" ]; then echo $PATH; ./build_and_test; fi
   - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./tools/travis_script_osx; fi
 
 after_success:
index c80f64d8eef0744e364b75b2ed230b9daabbdc02..ecf10d070f5f4d4c71a63d0426cd3dee6d723139 100644 (file)
@@ -262,7 +262,7 @@ linux{
   coverage.commands += ln -sf GPSBabel gpsbabel;
   coverage.commands += $(MAKE) CFLAGS=\"$(CFLAGS) -fprofile-arcs -ftest-coverage\" CXXFLAGS=\"$(CXXFLAGS) -fprofile-arcs -ftest-coverage\" LFLAGS=\"$(LFLAGS) --coverage\" &&
   coverage.commands += ./testo &&
-  coverage.commands += gcov -r $(SOURCES) &&
+  coverage.commands += gcov -r -o . $(SOURCES) &&
   coverage.commands += gcovr -r . --xml --exclude='zlib/*' --exclude='shapelib/*' -o gpsbabel_coverage.xml;
   QMAKE_EXTRA_TARGETS += coverage
 }
diff --git a/tools/travis_install_linux_local b/tools/travis_install_linux_local
new file mode 100755 (executable)
index 0000000..7195c96
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash -ex
+#
+# This script is run on travis for the install stage of mac builds.
+# Note the script must be sourced if you want the modified PATH to
+# be used outside this script.
+#
+
+# our expectation is that install-qt creates $QTDIR, $QTDIR/bin.
+QTDIR=${HOME}/Qt/5.9.7/gcc_64
+
+if [ -d "${QTDIR}/bin" ]; then
+  echo "Using cached Qt."
+  echo "If you need to clear the cache see"
+  echo "https://docs.travis-ci.com/user/caching/#Fetching-and-storing-caches."
+else
+  pushd ${HOME};
+  rm -fr Qt
+  # install_qt creates the install at $PWD/Qt.
+  QT_CI_PACKAGES=qt.qt5.597.gcc_64,qt.qt5.597.qtwebengine PATH=${TRAVIS_BUILD_DIR}/tools/qtci:${PATH} install-qt 5.9.7
+  popd;
+fi
+# note that qt-5.9.7.env created by install-qt is not cached!
+export PATH=${QTDIR}/bin:${PATH}
+unset -v QTDIR
+
+# prepare locale for test_encoding_latin1, requires locales package.
+sudo rm -rf /var/lib/apt/lists/* \
+  && sudo sed -i 's/^# *\(en_US ISO-8859-1\)/\1/' /etc/locale.gen \
+  && sudo locale-gen \
+  && locale -a
index 54731ce058f7de9cb3d0d03763d447cd07b4ab05..804e1770af9749180513771222b6eac789df7d67 100755 (executable)
@@ -20,9 +20,8 @@ make coverage
 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 if [ -v CODACY_PROJECT_TOKEN ] ; then
   # upload coverate report to codacy.
-  wget -nv -c https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.1/codacy-coverage-reporter-4.0.1-assembly.jar
-  java -jar codacy-coverage-reporter-4.0.1-assembly.jar report -l cpp -f -r gpsbabel_coverage.xml
+  wget -nv -c https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.3/codacy-coverage-reporter-4.0.3-assembly.jar
+  java -jar codacy-coverage-reporter-4.0.3-assembly.jar report -l cpp -f -r gpsbabel_coverage.xml
 else
   echo "Skipping codacy coverage upload as CODACY_PROJECT_TOKEN is not set."
 fi
-